import HttpAxios from "../../components/http/HttpAxios";

class LoginService{

  baseUrl = process.env.AUTH_SERVICE_URL;
  httpClient= new HttpAxios();

  userLoginUrl="/auth/user/token";

  adminLoginUrl="/auth/admin/token";
  adminRegisterUrl = "/auth/register";
  adminQueryRoleUrl = "/token/info";


  userLogin(data,call){
      this.httpClient.post(this.baseUrl+this.userLoginUrl,data,call);
  }
  adminLogin(data,call){
    this.httpClient.post(this.baseUrl+this.adminLoginUrl,data,call);
  }

  adminRegister(data,call){
    this.httpClient.post(this.baseUrl+this.adminRegisterUrl,data,call);
  }

  adminQueryRole(data,token,call){
    this.httpClient.getAndToken(this.baseUrl+this.adminQueryRoleUrl,data,token,call);
  }

}

export default LoginService;
